import { exInputNumber, exSelectAllowCreate, exInput, exSelect, exSwitch } from '@ve/common/components/extension'

export default {
  VERSION: '20220408',
  type: 'uiProgressCard',
  name: '进度条',
  icon: 'checkbox-blank-line',
  svg: 'jindutiao',
  //数据别名
  // dataName: 'uiFlexbox_data',
  //扩展
  extension: {
    requestSet: {
      type: 'exRequestSet',
      name: '接口配置',
      value: {
        api: '/wms/wms-web',
        method: 'wms.screen.query.test',
        getDataKey: 'wms.screen.query.test',
        cardValue: 'EDITWHO',
        isProgress: true,
        progressTotal: 1,
        progressNum: 0,
        loopRequest: false,
        loopTime: 3000,
        nameKey: '',
        valueKey: '',
        busList: [],
        dataObj: {},
        data: [
          { key: '#LIMIT#', value: '1' },
          { key: '#PAGE_SIZE#', value: '10' },
        ],
        resList: [],
      },
    },
    topMargin: {
      type: 'exInputNumber',
      name: '上外边距',
      value: 0,
    },
    rightMargin: {
      type: 'exInputNumber',
      name: '右外边距',
      value: 0,
    },
    bottomMargin: {
      type: 'exInputNumber',
      name: '下外边距',
      value: 0,
    },
    leftMargin: {
      type: 'exInputNumber',
      name: '左外边距',
      value: 0,
    },
    strokeWidth: exInputNumber('进度条宽度', 20, 1, 1000),
    progressRadius: exInputNumber('进度条圆角', 20, 1, 1000),
    pointNum: exInputNumber('小数位数', 0, 0, 10),
    progressTotal: exInput('进度条总数', 100),
    progressNum: exInput('当前值', 50),
    progressDir: exSelectAllowCreate(
      '进度条渐变背景方向',
      'to top',
      [
        {
          value: 'to top',
          label: '上',
        },
        {
          value: 'to right',
          label: '右',
        },
        {
          value: 'to bottom',
          label: '下',
        },
        {
          value: 'to left',
          label: '左',
        },
      ],
      '可自定义，如45deg等效于45度角'
    ),
    color: {
      type: 'exChartColor',
      name: '进度条颜色',
      value: [
        {
          v: '#EE6666',
        },
        {
          v: '#73C0DE',
        },
      ],
    },
    textColor: {
      type: 'exSetChartColor',
      name: '进度条文字颜色',
      value: '#EBEEF5',
    },
    textPosition: exSelect('进度条文字位置', 'right', [
      {
        label: '左',
        value: 'left',
      },
      {
        label: '居中',
        value: 'center',
      },
      {
        label: '右',
        value: 'right',
      },
    ]),
    fontSize: exInputNumber('进度条文字大小', 12, 1, 1000),
    titleFontWeight: exSelect('字体粗细', 500, [
      {
        label: '正常',
        value: 500,
      },
      {
        label: '加粗',
        value: 600,
      },
      {
        label: '特粗',
        value: 700,
      },
    ]),
    contentShow: exSwitch('是否显示内容值', true),
    contentFontSize: exInputNumber('内容文字大小', 12, 1, 1000),
    contentFontWeight: exSelect('内容字体粗细', 500, [
      {
        label: '正常',
        value: 500,
      },
      {
        label: '加粗',
        value: 600,
      },
      {
        label: '特粗',
        value: 700,
      },
    ]),
    contentFontColor: {
      type: 'exSetChartColor',
      name: '内容文字颜色',
      value: '#000',
    },
    bgColor: {
      type: 'exSetChartColor',
      name: '进度条底色',
      value: '#EBEEF5',
    },
  },
}
